// 元组定义：多种类型
const tuple: [string, number, boolean] = ['why', 18, true];

// 交叉类型使用。把多个类型合并为一个类型，称为交叉类型
const id: number | string = 123;
type Person = {
  name: string;
  age: number;
};
type Gender = {
  gender: string;
};
const person: Person & Gender = {
  name: '小黑',
  age: 3,
  gender: 'male'
};
console.log(person);
